package com.starlink.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.starlink.model.domain.UserVipSetDO;
import com.starlink.model.request.UserVipSetRequest;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author zhanghong
 */
@Repository
public interface UserVipSetMapper extends BaseMapper<UserVipSetDO> {
    UserVipSetDO selectDOById(Long id);
    List<UserVipSetDO> selectDOList(UserVipSetDO userVipSet);
    int insertDO(UserVipSetDO userVipSet);
    int batchInsertDO(List<UserVipSetDO> userVipSetDOList);
    int updateDO(UserVipSetDO userVipSet);
    int deleteDOById(Long id);
    int deleteDOByIds(String[] ids);

    @Select({"<script>",
            "   select count(1) from user_vip_set",
            "   <where>",
            "       deleted=0",
            "       <if test=\"1==0\">and id=#{param.id}</if>",
            "   </where>",
            "</script>"})
    long pageCount(@Param("param") UserVipSetRequest param);

    List<UserVipSetDO> pageQuery(@Param("param") UserVipSetRequest param);
}
